﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 练习
{
    struct Vector
    {
        public float x, y, z;
        public Vector(float a, float b, float c)
        {
            x = a;
            y = b;
            z = c;
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            Vector vec1 = new Vector(1, 2, 3);
            Vector vec2 = new Vector(1, 3, 8);
            Vector vec3 = new Vector(2, 4, 5);

            Vector[] vecs = new Vector[] { vec1, vec2, vec3, vec1 };

            for (int i = 0; i < vecs.Length - 1; i++)
            {
                Vector max;
                if (vecs[i].x > vecs[i+1].x)
                {
                    max = vecs[i];
                }
                else if (vecs[i].x == vecs[i+1].x)
                {
                    if (vecs[i].y > vecs[i+1].y)
                    {
                        max = vecs[i];
                    }
                    else if (vecs[i].y == vecs[i+1].y)
                    {
                        if (vecs[i].z >= vecs[i+1].z)
                        {
                            max = vecs[i];
                        }
                        else
                        {
                            max = vecs[i+1];
                        }
                    }
                    else
                    {
                        max = vecs[i+1];
                    }
                }
                else
                {
                    max = vecs[i+1];
                }
            }
        }
    }
}
